package com.bop.dehong;

import android.view.View;
import android.widget.AdapterView;
import android.widget.Switch;

import com.bop.dehong.base.BaseActivity;
import com.bop.dehong.config.Config;

/**
* @author TangWenhan/YeFengyun
*/
public class ChooseIPdAct extends BaseActivity{
	
	private Switch mSwitchIp;

	@Override
	protected void initTop() {
	}

	@Override
	protected void initUI() {
		mSwitchIp = getView(R.id.switch1);
		registerOnClickListener(getView(R.id.button1));
	}

	@Override
	protected void initData() {
	}
	

	@Override
	protected int getContentViewId() {
		return R.layout.act_choose_ip;
	}

	@Override
	public void onClick(View v)
	{
		switch (v.getId())
		{
		case R.id.button1:
			if (mSwitchIp.isChecked()) {//正式
				Config.IP = Config.IPs[0];
			}else {//测试
				Config.IP = Config.IPs[1];
			}
			setResult(RESULT_OK);
			finishCurrentActivity();
			break;

		default:
			break;
		}
	}

	@Override
	public void onItemClick(AdapterView<?> parent, View view, int position,
			long id)
	{
		// TODO Auto-generated method stub
		
	}

}

